package com.lmq.backend.controller.user.bot;

import com.lmq.backend.pojo.Bot;
import com.lmq.backend.service.user.bot.BotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/user")
public class BotController {

    @Autowired
    BotService botService;

    @PostMapping("/bot/add/")
    public Map<String, String> add(@RequestParam Map<String, String> data) {
        return botService.add(data);
    }

    @PostMapping("/bot/remove/")
    public Map<String, String> remove(@RequestParam Map<String, String> data) {
        return botService.remove(data);
    }

    @PostMapping("/bot/update/")
    public Map<String, String> update(@RequestParam Map<String, String> data) {
        return botService.update(data);
    }

    @GetMapping("/bot/getList/")
    public List<Bot> getList() {
        return botService.getList();
    }
}
